<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/dhj/borrow/View_Borrow.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/dhj/borrow/View_Borrow.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'BorrowId',
                footer: "Foots",
                cnName: '借用详情',
                name: 'borrow/View_Borrow',
                url: "/View_Borrow/",
                sortName: "BorrowId"
            });
            const editFormFields = ref({"Item":"","Time":"","Name":"","Sex":"","Tel":""});
            const editFormOptions = ref([[{"title":"借用物品","field":"Item"},
                               {"title":"借用时间","field":"Time","type":"date"}],
                              [{"title":"借用人姓名","field":"Name"},
                               {"dataKey":"男女性别","data":[],"title":"借用人性别","field":"Sex","type":"select"},
                               {"title":"借用人电话","field":"Tel","type":"phone"}]]);
            const searchFormFields = ref({"Item":"","Time":"","Name":"","Sex":"","Tel":""});
            const searchFormOptions = ref([[{"title":"借用物品","field":"Item","type":"like"},{"title":"借用时间","field":"Time","type":"datetime"}],[{"title":"借用人姓名","field":"Name","type":"like"},{"dataKey":"男女性别","data":[],"title":"借用人性别","field":"Sex","type":"select"},{"title":"借用人电话","field":"Tel","type":"phone"}]]);
            const columns = ref([{field:'BorrowId',title:'BorrowId',type:'int',sort:true,width:110,hidden:true,require:true,align:'left'},
                       {field:'Item',title:'借用物品',type:'string',width:220,align:'left',sort:true},
                       {field:'Time',title:'借用时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'PersonId',title:'PersonId',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Name',title:'借用人姓名',type:'string',width:110,align:'left'},
                       {field:'Sex',title:'借用人性别',type:'string',bind:{ key:'男女性别',data:[]},width:110,align:'left'},
                       {field:'Tel',title:'借用人电话',type:'string',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
